﻿using System;
using Transformable_Engine_v2.Engine.Helper;

namespace Transformable_Engine_v2.Engine.Animation.Trajectory
{
    public class SinusTrajectory : BaseTrajectory
    {
        private readonly int _frequency;

        public SinusTrajectory(int frequency = 1)
        {
            _frequency = frequency;
        }

        public override double GetPercentageProgression(double elapsedDurationTime)
        {
            return 1 - (1 + Math.Cos(elapsedDurationTime.TimesTwoPi()*_frequency)) * 0.5;
        }
    }
}